package com.cskaoyan.javase._1interface._4example.model;

/**
 * 商品类
 * @since 15:05
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Goods {
    // 商品的id,是唯一标识
    private int id;
    private String name;
    private double price;
    private String brand;

    public Goods() {
    }

    public Goods(int id, String name, double price, String brand) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.brand = brand;
    }

    // 提供一个方法,用于展示商品信息
    public void showGoods() {
        System.out.println("id为" + id + "的商品,它的品牌是" + brand + ",它的名字是" + name + ",它的价格是" + price);
    }

    public int getId() {
        return id;
    }
}
